#ifndef __REFERENCE_H__
#define __REFERENCE_H__

#include <iostream>
#include <stdlib.h>
#include "ReadSet.h"

using namespace std;

class Reference {
public:
	string chrName;
	char* base;
	unsigned long length;
	unsigned int* code;		//binary encoded
	unsigned int numEncodedWord;	//the length of code

	Reference() {
		chrName = "";
		base = NULL;
		code = NULL;
		length = 0;
	}

	~Reference() {
		delete[] base;
		delete[] code;
		chrName = "";
		length = 0;	
	}

	void encode() {
		//encode the base to code using binary encodiing
		numEncodedWord = ReadSet::numEncodedWord(length);
		code = new unsigned int[numEncodedWord];
		ReadSet::encodeSingle(code, base, length);
	}
};

#endif /*__REFERENCE_H__*/
